<template>
    <view class="">
        <view>
            <view class="express">
                <view class="info">
                    <view :class="{hide:!iSinfo}">{{content}}</view>
                    <view class="tips" @click="showinfo" v-if="!iSinfo">						
                        <u-icon name="arrow-down" size="12" color="#3882F4" label="展开" labelPos="left" labelColor="#3882F4" labelSize="14"></u-icon>
                    </view>
                </view>
                <view class="tips hidebtn" @click="showinfo" v-if="iSinfo">
                    <u-icon name="arrow-up" size="12" color="#3882F4" label="收起" labelPos="left" labelColor="#3882F4" labelSize="14"></u-icon>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
    export default {
		props:{
			 content: { type: String, default: `简介：山不在高，有仙则名。水不在深，有龙则灵。斯是陋室，惟吾德馨。
                        苔痕上阶绿，草色入帘青。谈笑有鸿儒，往来无白丁。可以调素琴，阅金经。
                        无丝竹之乱耳，无案牍之劳形。南阳诸葛庐，西蜀子云亭。孔子云：何陋之有？西蜀子云亭。孔子云：何陋之有？` },
		},
        data(){
            return {
                iSinfo: false,                
            }
        },
        methods:{
            // 全文展开收起
            showinfo() {
                this.iSinfo = !this.iSinfo
            }
        }
    }
</script>

<style lang="scss" scoped>
    // 展开收起
    .express {
        display: flex; 
        flex-direction: column;
        background-color: #fff;
        padding: 0rpx 30rpx 0rpx 30rpx;
        font-size: 29rpx;
        position: relative;
        .info {
            display: flex;
            flex-direction: column;
            .tips {
                width: 140rpx;
                height: 40rpx;
                display: flex;				
                justify-content: flex-end;
                align-items: center;
                background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 50%);                
                position: absolute;
                bottom: 0rpx;
                right: 30rpx;
            }
        }

    }
    // 收起 按钮
    .hidebtn {
        display: flex;
        flex: 1;
        justify-content: flex-end;
        color: #3882F4;
        font-size: 30rpx; 
    }
    // 展开 文字
    .hide {
        word-break: break-word; //换行模式
        overflow: hidden;
        text-overflow: ellipsis; //修剪文字，超过2行显示省略号
        display: -webkit-box;
        -webkit-line-clamp: 1; //此处为上限行数
        -webkit-box-orient: vertical;
		font-size: 30rpx;
    }

</style>
